/* Copyright 2014-2018 Rsyn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* 
 * File:   LayerViaManager.h
 * Author: jucemar
 *
 * Created on February 3, 2018, 9:31 AM
 */
namespace Rsyn {

inline const std::vector<Rsyn::PhysicalVia> & LayerViaManager::allVias(Rsyn::PhysicalLayer layer) const {
	return data->clsVias[layer];
} // end method 

// -----------------------------------------------------------------------------

inline const std::vector<Rsyn::PhysicalVia> & LayerViaManager::allBottomVias(Rsyn::PhysicalLayer layer) const {
	return data->clsBottomVias[layer];
} // end method 

// -----------------------------------------------------------------------------

inline const std::vector<Rsyn::PhysicalVia> & LayerViaManager::allTopVias(Rsyn::PhysicalLayer layer) const {
	return data->clsTopVias[layer];
} // end method 

// -----------------------------------------------------------------------------

inline bool LayerViaManager::hasVias(Rsyn::PhysicalLayer layer) const {
	if(layer == nullptr)
		return false;
	if(layer.getType() != Rsyn::PhysicalLayerType::ROUTING)
		return false;
	const std::vector<Rsyn::PhysicalVia> & vias  = data->clsVias[layer];
	return vias.size() > 0;
} // end method 

// -----------------------------------------------------------------------------

inline bool LayerViaManager::hasBottomVias(Rsyn::PhysicalLayer layer) const {
	if(layer == nullptr)
		return false;
	if(layer.getType() != Rsyn::PhysicalLayerType::ROUTING)
		return false;
	const std::vector<Rsyn::PhysicalVia> & vias  = data->clsBottomVias[layer];
	return vias.size() > 0;
} // end method 

// -----------------------------------------------------------------------------

inline bool LayerViaManager::hasTopVias(Rsyn::PhysicalLayer layer) const {
	if(layer == nullptr)
		return false;
	if(layer.getType() != Rsyn::PhysicalLayerType::ROUTING)
		return false;
	const std::vector<Rsyn::PhysicalVia> & vias  = data->clsTopVias[layer];
	return vias.size() > 0;
} // end method 

// -----------------------------------------------------------------------------

} // end namespace 
